package com.ruoyi;

import dev.langchain4j.model.ollama.OllamaChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @description:
 * @author: lizhihua
 * @date: 2025/6/7
 */
@SpringBootTest
public class LlmDemo {

    @Autowired
    private OpenAiChatModel openAiChatModel;
    @Autowired
    private OllamaChatModel ollamaChatModel;

    @Test
    public void test(){
        String chat = openAiChatModel.chat("你是谁");
        System.out.println(chat);
    }

    @Test
    public void test1(){
        String chat = ollamaChatModel.chat("你是谁");
        System.out.println(chat);
    }
}
